<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="AddressCreateDlg" widgetVar="AddressCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{message.CreateAddressTitle}">
            <h:form id="AddressCreateForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{addressController.selected != null}">
                        <p:outputLabel value="#{message.CreateAddressLabel_addressID}" for="addressID" />
                        <p:inputText id="addressID" value="#{addressController.selected.addressID}" title="#{message.CreateAddressTitle_addressID}" required="true" requiredMessage="#{message.CreateAddressRequiredMessage_addressID}"/>
                        <p:outputLabel value="#{message.CreateAddressLabel_city}" for="city" />
                        <p:inputText id="city" value="#{addressController.selected.city}" title="#{message.CreateAddressTitle_city}" />
                        <p:outputLabel value="#{message.CreateAddressLabel_civilNumber}" for="civilNumber" />
                        <p:inputText id="civilNumber" value="#{addressController.selected.civilNumber}" title="#{message.CreateAddressTitle_civilNumber}" />
                        <p:outputLabel value="#{message.CreateAddressLabel_country}" for="country" />
                        <p:inputText id="country" value="#{addressController.selected.country}" title="#{message.CreateAddressTitle_country}" />
                        <p:outputLabel value="#{message.CreateAddressLabel_street}" for="street" />
                        <p:inputText id="street" value="#{addressController.selected.street}" title="#{message.CreateAddressTitle_street}" />
                    </p:panelGrid>
                    <p:commandButton actionListener="#{addressController.create}" value="#{message.Save}" update="display,:AddressListForm:datalist,:growl" oncomplete="handleSubmit(args,'AddressCreateDialog');"/>
                    <p:commandButton value="#{message.Cancel}" onclick="AddressCreateDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
